﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Web;
using Hangfire;

namespace Hello_Hangfire
{
    public class Class1
    {
        public static void RecurringJob_AddOrUpdate(Expression<Action> methodCall)
        {
            RecurringJob.AddOrUpdate(methodCall, Cron.Minutely);
        }



        public static void Log(string strMess = "test")
        {
            try
            {
                string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "/test.txt";
                using (StreamWriter writer = new StreamWriter(path, true, Encoding.Default))
                {
                    writer.WriteLine(DateTime.Now + "==============================================");

                    writer.WriteLine(strMess);
                    writer.Dispose();
                    writer.Close();
                }
            }
            catch
            {
            }
            //return strMess;
        }
    }
}